Acorn Assembler

Contents


Assembler tools

This user guide

Conventions used in this manual

Part 1 - Using the assembler

ObjAsm

Starting ObjAsm

The SetUp dialogue box

The SetUp menu

ObjAsm output

ObjAsm icon bar menu

Example ObjAsm session

ObjAsm command lines

Part 2 - Assembly language details

The ARM CPU

Introduction

Block diagram of core

26 bit architecture

32 bit architecture

Exceptions

ARM assembly language

General

Input lines

AREAs

ORG and ABS

Symbols

Labels

Local labels

Comments

Constants

The END directive

CPU instruction set

The condition field

Instruction timings

The barrel shifter

Shift types

Coprocessor instructions

Branch, Branch with Link (B, BL)

Data processing

PSR transfer (MRS, MSR)

Multiply and Multiply-Accumulate (MUL, MLA)

Multiply Long and Multiply-Accumulate Long (UMULL, SMULL, UMLAL, SMLAL)

Single data transfer (LDR, STR)

Block data transfer (LDM, STM)

Single data swap (SWP)

Software interrupt (SWI)

Coprocessor data operations (CDP)

Coprocessor data transfers (LDC, STC)

Coprocessor register transfers (MCR, MRC)

Undefined instructions

Instruction set summary

Further instructions

Extended range immediate constants

The ADR instruction

The ADRL instruction

Literals

Floating point instructions

Programmer's model

Available systems

Precision

Floating point number formats

Floating point status register

Floating Point Control Register

Assembler directives and syntax

The instruction set

Finding out more...

Directives

Storage reservation and initialisation - DCB, DCW and DCD

Floating point store initialisation - DCFS and DCFD

Describing the layout of store - ^ and #

Organisational directives - END, ORG, LTORG and KEEP

Links to other object files - IMPORT and EXPORT

Links to other source files - GET/INCLUDE

Diagnostic generation - ASSERT and !

Dynamic listing options - OPT

Titles - TTL and SUBT

Miscellaneous directives - ALIGN, NOFP, RLIST and ENTRY

Symbolic capabilities

Setting constants

Local and global variables - GBL, LCL and SET

Variable substitution - $

Built-in variables

Expressions and operators

Unary operators

Binary operators

Conditional and repetitive assembly

Conditional assembly

Repetitive assembly

Macros

Syntax

Local variables

MEXIT directive

Default values

Macro substitution method

Nesting macros

A division macro

Part 3 - Developing software for RISC OS

Exception handling

RISC OS processor configuration and modes

The pre-veneers

Claiming the hardware vectors

Writing to the FIQ vector

Writing relocatable modules in assembler

Assembler directives

Example

Interworking assembler with C

Examples

Part 4 - Appendixes

Changes to the assembler

Error messages

Example assembler fragments

Using the conditional instructions

Pseudo-random binary sequence generator

Multiplication by a constant

Loading a word from an unknown alignment

Sign/zero extension of a half word

Return setting condition codes

Full multiply

Warnings on the use of ARM assembler

Restrictions to the ARM instruction set

Instructions and code sequences to avoid

Static ARM problems

Support for AAsm source

The -ABSolute option